{php}
$share = is_array($share)?array_merge($info?:[],$share):$info;
isset($share['about'])||$share['about'] = get_word(del_html($share['content']),150);
isset($share['link'])||$share['link'] = get_url('location');
preg_match('/^(http:|https:)/',$share['link']) || $share['link'] = request()->domain().$share['link'];
preg_match('/^(http:|https:)/',$share['picurl']) || $share['picurl'] = request()->domain().$share['picurl'];
{/php}
<style>
.Share_Message{ 
	position: fixed; 
	width:100%; 
	height: 100%; 
	background: rgba(0,0,0,0.8);
	z-index: 900000; 
	top:0; 
	left: 0; 
	display: none;
}
.Share_Message div{
	background:url(__STATIC__/images/sharebg.png) no-repeat right center; 
	width:100%; 
	height:350px; 
	background-size:contain; 
	top:0; 
	display: block;
}
</style>
<script type="text/javascript">
function SharShowMsg(){
	var t = $(document).height();
	$('.Share_Message').html('<div></div>');
	$('.Share_Message').height(t).fadeIn();
}
function SharHiddenMsg() {
	$('.Share_Message').fadeOut();
}
</script>
<div class="Share_Message" onClick="SharHiddenMsg();"></div>
<script src="__STATIC__/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
  wx.config({
    debug: false,
    appId: '{:weixin_share("appId")}',
    timestamp: {:weixin_share("timestamp")},
    nonceStr: '{:weixin_share("nonceStr")}',
    signature: '{:weixin_share("signature")}',
    jsApiList: [
        'checkJsApi',
		'onMenuShareTimeline',
        'onMenuShareAppMessage', 
		'hideMenuItems',
        'showMenuItems',
      ]
  });


 function ShareTimeline(){
    wx.onMenuShareTimeline({
      title: '{$share.title} {$share.about}',
      link: '{$share.link}',
      imgUrl: '{$share.picurl}',
      trigger: function (res) {
        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
        //alert('分享到朋友圈后，每进来一位新用户，你都将获得{$webdb[CommendRegHongBao]}元红包的奖励，你若取消关注公众号，将不派发！');
      },
      success: function (res) {
        layer.msg('成功分享到朋友圈');
		//window.location.reload();
		//window.location.href='?id=$id&hid=$hid&job=have_shareTimeline';
      },
      cancel: function (res) {
        //alert('系统监测到你没有真正分享到朋友圈，请重新分享！');
      },
      fail: function (res) {
        alert(JSON.stringify(res));
      }
    });
	wx.showOptionMenu();
	//SharShowMsg();
    //alert('请点击左上角的菜单，然后分享到朋友圈去即可');
}

function ShareAppMessage(){
	wx.onMenuShareAppMessage({
      title: '{$share.title}',
      desc: '{$share.about}',
      link: '{$share.link}',
      imgUrl: '{$share.picurl}',
      trigger: function (res) {
        // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
		//alert('请分享到朋友圈去，分享到微信好友无效！');
      },
      success: function (res) {
		  layer.msg('成功分享到好友');
		//window.location.href='?job=have_shareFriend';
      },
      cancel: function (res) {
        //alert('你已取消操作，建议你重新分享给好友！');
      },
      fail: function (res) {
        alert(JSON.stringify(res));
      }
    });
    //alert('请点击左上角的菜单，发送给朋友');
}

wx.ready(function () {
	//wx.hideOptionMenu();
  //监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
 // document.querySelector('#onMenuShareTimeline').onclick = function () {
	ShareTimeline();
  //};
   //监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
  //document.querySelector('#onMenuShareAppMessage').onclick = function () {
	ShareAppMessage();
 // };
});
wx.error(function (res) {
  alert(res.errMsg);
});

</script>